<?php

$save_frame = $_SESSION[$G_admin_session_key]['save_frame'];
$back_url   = get_current_url();
cookie('back_url', strcode($back_url));
$url_cur    = get_current_url(array('orderby', 'desc'));


require($abs_admin_cppath . '/header.php');
?>

<div class="datacontainer1" id="listDiv" alt='treelist'>
<TABLE BORDER="0" CELLPADDING="4" CELLSPACING="1" width="100%" class="list_table">
<THEAD>
	<TR class="list_head">
		<!-- <TH scope=col width="40">#</TH> -->
		<TH scope=col width="60">ID</TH>
		<TH scope=col width="60">排序</TH>
		<TH scope=col class="textc">分类名称</TH>
		<TH scope=col width="260"> 分类操作</TH>
	</TR></THEAD>
<?php
$tr_class = '';
foreach($class_list as $k => $v) {
    $tr_class   = $tr_class != 'tr0' ? 'tr0' : 'tr1';
    $node_pre   = tree_node_htmlpre($v['__node_pre'], 1);
    //$order_no   = ($v['order_no'] >= $G_big_integer || $v['order_no'] <= 0) ? '' : $v['order_no'];
    $order_no   = ($v['order_no'] >= $G_big_integer || $v['order_no'] <= 0) ? '默认' : $v['order_no'];
?>
<TR class="<?php echo $tr_class; ?>" onmouseover="return chgBg(this, 1);" onmouseout="return chgBg(this, 0);">
<?php
if($v['__level__'] == 1){
?>
	<TD width="60"><?php //echo $v['cid'] ?></TD>
	<TD align="center">&nbsp;</TD>
    <TD align="left"><?php echo $node_pre ?><?php echo $v['cname']; ?></TD>
    <TD>
		<a href="<?php echo $mod_url['c.add'];    ?>&pid=<?php echo $v['cid']; ?>" class="btn_addsub fl">新增下级</a>
    </TD>
<?php
} else {
?>
    <TD width="60" align="center"><?php echo $v['cid'] ?></TD>
	<TD align="center"><span title="<?php echo $order_no; ?>" onclick="listTable.edit(this, 'edit_order_no', '<?php echo $v['cid']; ?>')"><?php echo $order_no; ?></TD>
    <TD align="left"><?php echo $node_pre ?><span title="<?php echo $v['cname']; ?>" onclick="listTable.edit(this, 'edit_cname', '<?php echo $v['cid']; ?>')"><?php echo $v['cname']; ?></span></TD>
    <TD>
		<a href="<?php echo $mod_url['li'];       ?>&cid=<?php echo $v['cid']; ?>" class="btn_content fl">管理内容</a>
        <a href="<?php echo $mod_url['c.modify']; ?>&cid=<?php echo $v['cid']; ?>" class="btn_modify fl" title="修改栏目">修改</a>
        <?php if($v['cid']!=16){?>
        <a href="<?php echo $mod_url['c.del'];    ?>&cid=<?php echo $v['cid']; ?>" onClick="if(!confirm('确定要删除这条记录吗？\r\n\r\n删除后将无法恢复！')) return false;" target="<?php echo $save_frame ?>" class="btn_del fl" title="删除栏目">删除</a>
        <?php }?>
    </TD>
<?php
}
?>
</TR>
<?php
}
?>
</TABLE>
</div>
<?php
require($abs_admin_cppath . '/footer.php');
?>